package SEApp.dialogs
{
	import UIFree.uif_component;
	
	import flash.geom.Rectangle;
	import flash.text.TextField;

	public class se_promt extends se_alert {
		public function se_promt(parent: uif_component, a_title: String, descr: String='', editText: String='', 
										closeFunc: Function=null) {
			super(parent, descr, closeFunc, true);
			title.text = a_title;
			
			var inner: Rectangle = getInner();
			var inputField: TextField = new TextField();
			inputField.border = true;
			inputField.x = inner.x;
			inputField.y = inner.height - 40;
			inputField.height = 20;
			inputField.type = 'input';
			inputField.text = editText;
			app.stage.focus = inputField;
			inputField.setSelection(0, editText.length);
			inputField.width = inner.width;
			addChild(inputField);
		}
		
		override protected function resizeFromText(): Rectangle {
			var rect: Rectangle = super.resizeFromText();
			height += 30;
			rect.height += 30;
			return rect;
		}
	}
}